package com.nanohadoop.mapreduce.core;

import java.io.IOException;

/**
 * 记录读取器接口，用于读取输入数据
 */
public interface RecordReader<K, V> {
    /**
     * 读取下一对键值对
     */
    boolean nextKeyValue() throws IOException, InterruptedException;

    /**
     * 获取当前key
     */
    K getCurrentKey() throws IOException, InterruptedException;

    /**
     * 获取当前value
     */
    V getCurrentValue() throws IOException, InterruptedException;

    /**
     * 获取读取进度
     */
    float getProgress();

    /**
     * 关闭读取器
     */
    void close() throws IOException;
}
